home *** CD-ROM | disk | FTP | other *** search
- /* cvinit.c
- * initialization called the first time (taken care of by the
- * makefile.
- ************************************************************************/
-
- #include <stdio.h>
- #include <fcntl.h>
- #include "cvmisc.h"
- #include "cvinit.h"
-
- extern long time();
- extern long ptime;
-
- cvinit(argc,argv)
- int argc;
- char *argv[];
- {
- auto int r;
- auto unsigned length;
- auto long where,offset;
- extern char datastart,bssstart;
- if ( (r = open(path,O_RDWR|O_EXCL|O_CREAT,0700)) == EOF) {
- perror(argv[0]);
- exit(1);
- }
- fixrmsg(); /* fix up messages that are too long for C */
- checkloc(); /* check the location array */
- checkobj(); /* check the objects array */
- saved = 1;
- (void) time(&ptime);
- length = &bssstart - &datastart;
- if (write(r,&datastart,length) == EOF) {
- perror(argv[0]);
- exit(1);
- }
- if (close(r)) {
- perror(argv[0]);
- exit(1);
- }
- return;
- }
-